<template>
  <ContentWrap :title="'会员信息'" class="!mb-10px">
    <template #header>
      <slot name="tool"></slot>
    </template>
    <el-scrollbar height="220px">
      <el-row class="custom-text-14">
        <el-col :span="12">
          <div class="mb-15px">
            姓名|昵称: <span class="ml-5px"> {{ orderData?.user?.nickname }}</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="mb-15px">
            性别:
            <dict-tag
              :type="DICT_TYPE.SYSTEM_USER_SEX"
              class="ml-5px"
              :value="orderData?.user?.sex"
            />
          </div>
        </el-col>
        <el-col :span="12">
          <div class="mb-15px">
            手机号:
            <span class="ml-5px"> {{ phoneFormat(orderData?.user?.mobile) }}</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="mb-15px">
            生日:
            <span class="ml-5px"> {{ orderData?.user?.birthday || '无' }}</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="mb-15px">
            会员等级:
            <span class="ml-5px"> {{ orderData?.user?.levelName || '无' }}</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="mb-15px">
            付费会员:
            <span class="ml-5px"> {{ orderData?.user?.memberShipName || '无' }}</span>
          </div>
        </el-col>
        <el-divider border-style="dashed" class="mt-0! mb-15px!" />
        <el-col :span="12">
          <div class="mb-15px">
            归属员工:
            <span class="ml-5px"> {{ orderData?.user?.employee || '无' }}</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="mb-15px">
            注册门店:
            <span class="ml-5px"> {{ orderData?.user?.tenantName || '无' }}</span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            注册日期:
            <span class="ml-5px">
              {{ orderData?.user?.createTime ? formatDate(orderData?.user?.createTime) : '无' }}
            </span>
          </div>
        </el-col>
        <el-col :span="12">
          <div>
            最近登录:
            <span class="ml-5px">
              {{ orderData?.user?.activeTime ? formatDate(orderData?.user?.activeTime) : '无' }}
            </span>
          </div>
        </el-col>
      </el-row>
    </el-scrollbar>
  </ContentWrap>
</template>
<script lang="ts" setup>
import { formatDate } from '@/utils/formatTime'
import { propTypes } from '@/utils/propTypes'
import { DICT_TYPE } from '@/utils/dict'
import { phoneFormat } from '@/utils/formatter'

defineOptions({ name: 'OrderMemberInfo' })

defineProps({
  orderData: propTypes.object.def({})
})
</script>
